# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py3-pep8-naming
pkgver=0.14.1
pkgrel=0
pkgdesc="Check PEP-8 naming conventions plugin for flake8"
url="https://github.com/PyCQA/pep8-naming"
arch="noarch"
license="MIT"
depends="python3 py3-flake8"
makedepends="py3-setuptools py3-gpep517"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/p/pep8-naming/pep8-naming-$pkgver.tar.gz"
builddir="$srcdir/pep8-naming-$pkgver"

replaces="py-pep8-naming" # Backwards compatibility
provides="py-pep8-naming=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	gpep517 install-wheel --destdir .testenv --prefix '' .dist/*.whl
	.testenv/bin/python3 run_tests.py
}

package() {
	gpep517 install-wheel --destdir "$pkgdir" \
		.dist/*.whl
}

sha512sums="
1d6a1e66b87dc1e0b408dc7ef433aa8a8d1f323487a63faf160d5cce27361bb572a40d1c8bd6ff971cf11593274d52ac889f5adc208c40585e1bc126d32fbbba  pep8-naming-0.14.1.tar.gz
"
